<!-- cLose container divs so we can be full-width -->
</div>
</div>

<script src="/assets/wikis.js" type="text/javascript"></script>

<style>
.tag-header {
  margin-top: -21px;
}
.alerts-container {
  position: absolute;
  z-index: 999;
  width: 100%;
  left: 0;
  padding: 0 20px;
}
@media screen and (max-width: 400px) {
  .tag-header {
    margin-top: -30px;
  }

  .btn-outline-secondary{
    margin-top: 10px;
  }
}

.fdb-block {
  box-shadow: 0;
  margin-bottom: 0;
  transition: margin 0.25s linear 0.25s;
  padding: 3.5rem 0;
  position: relative;
  background-size: cover;
  background-color: #FFF;
}
.fdb-block, .rounded {
  overflow: visible;
}
.fdb-block, .fdb-block .container {
  background-position: center;
  background-repeat: no-repeat;
}
.fdb-block .container {
  background-size: contain;
}
.fdb-block, .fdb-block .container {
  background-position: center;
  background-repeat: no-repeat;
}
.fdb-block .fdb-box {
  color: #444;
  border-radius: .25rem;
  position: relative;
}
.fdb-box-content-wrapper{
  z-index: 1;
  padding: 2.75rem 2.5rem;
  background: #FFF;
  position: relative;
}
.fdb-box::after{
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 10px;
  z-index: 0;
  box-shadow: 0 .3125rem .875rem 0 rgba(129,129,129,.2)!important; 
}
.fdb-block .rounded-bottom-0 {
  border-bottom-left-radius: 0!important;
  border-bottom-right-radius: 0!important;
}
.wiki-sub {
  overflow: hidden; color: #666; height: 70px; 
}
.popover{
  z-index:1000;
}
</style>

<section class="tag-header fdb-block pb-0" style="<% if @wiki && @wiki.main_image %>background-image: url(<%= @wiki.main_image.path %>);<% else %>background: #eee;<% end %>" data-block-type="contents" data-id="1">

    <div class="container">
        <div class="row text-left justify-content-start">
            <div class="col-12 col-md-6 col-xl-5"><div class="fdb-box rounded-bottom-0">
                  <div class='fdb-box-content-wrapper'>
                    <div class="pull-right"><%= render :partial => "tag/show/user_controls" %></div>

                    <h1 style="margin-top:6px; word-wrap:break-word;">
                        <%= @wiki&.latest&.title || @title %>

                        <div style="font-family: 'Helvetica Neue',Arial,sans-serif;font-size: 16px;">
                            <span style="white-space: nowrap;">
                                <span rel="tooltip" title="This 'tagname' forms part of the URL for this topic." class="badge badge-secondary" style="background: #ccc;color: white;">
                                    <%= params[:id] %>
                                </span>
                                <a rel="tooltip" title="Show related topics" onclick="$('.related-tags').show();$(this).hide();"><i class="fa fa-plus-circle" style="vertical-align: middle;color:#ccc;"></i></a>
                            </span>
                            <span class="related-tags" style="display:none;">
                                <% unless @related_tags.nil? %>
                                    <% @related_tags.each do |tag| %>
                                        <a href="/tag/<%= tag.name %>" class="badge badge-secondary" style="background: #aaa;color: white;">
                                            <%= tag.name %>
                                        </a>
                                    <% end %>
                                <% end %>
                            </span>
                        </div>
                    </h1>

                    <% if @wildcard %>

                        <% if @node_type == "questions"%>
                            <p><i>Showing <b>questions</b></i></p>
                        <% elsif @node_type == "note" && params[:id].match("activity:") %>
                            <p><i>Showing <b>activities</b></i></p>
                        <% elsif @node_type == "note" && params[:id].match("replication:") %>
                            <p><i>Showing <b>completed activities</b></i></p>
                        <% end %>

                        <p><i>This is a wildcard (*) tag search. Please enter a tag without wildcards to display lead wiki pages.</i></p>

                    <% end %>

                    <% if @wiki %>
                      <p class = "wiki-sub wiki-summary" id="wiki-summary"><%= strip_tags(@wiki.latest.body.split('\n').first) %>...</p>
                    <% end %>

                    <div class="tag-buttons">
                        <div class="btn-group" role="group">
                            <% if current_user && current_user.following(params[:id]) %>
                                <a data-toggle="tooltip" title="<%= translation('sidebar._post_button.share_your_work',{},false) %>" data-placement="bottom" href="/post?tags=<%= @title %>" class="btn btn-primary requireLogin">New post <i class="fa fa-plus fa-white"></i></a>
                            <% else %>
                                <a class="btn btn-primary requireLogin" target="_blank" href="/subscribe/tag/<%= params[:id] %>"> Follow</a>
                                <% if @related_tags %>
                                    <a><%= render partial: 'tag/dropdown_subscribe', locals: { tags: @related_tags, buttonStyle: "btn-primary"} %></a>
                                <% end %>
                            <% end %>
                        </div>
                        <% core_tag = params[:id].gsub('question:','') %>
                        <% if @wiki %>
                            <a><%= link_to("Learn more &raquo;".html_safe, "/wiki/#{core_tag}", :class=> "btn btn-outline-secondary")%></a>
                        <% else %>
                            <a class="btn btn-outline-secondary" href="/wiki/new?title=<%= core_tag %>">Add a description <span class="fa fa-plus"></span></a>
                        <% end %>
                    </div>
                  </div>
                </div></div>
        </div>
    </div>

</section>

<br />

<div class="container">
<div class="row">

<% cache("tag-show-#{request.fullpath}", expires_in: 5.minutes, skip_digest: true) do %>
<div class="container">
  <div class="box">
    <div class="row">
      <div class="col-md-12">
        <% unless @node_type == 'comments' %>
          <%= render partial: 'tag/show/contributors' %>
          <%= render partial: 'tag/show/sort' %>
        <% end %>
        <%= render partial: 'tag/show/nav_tabs' %>
        <%= render partial: 'tag/show/tab_content' %>
        <div>
          <script type="text/javascript">
            $('#questions .btn-group .btn').click(function(){
              $(this).addClass('active').siblings().removeClass('active');
            });
          </script>
        </div>
      </div>
    </div>
  </div>
</div>
<% end %>

<%= stylesheet_link_tag "dashboard" %>

<style>
  .node-types .nav-link {
    color: #495057;
  }
  .contributor-info,
  .contributor-info a i,
  .contributor-info a:link i,
  .contributor-info a:active i,
  .contributor-info a:visited i {
    color: #aaa;
  }
  .contributor-info a,
  .contributor-info a:link,
  .contributor-info a:active,
  .contributor-info a:visited  {
    color: currentColor;
    text-decoration: underline;
  }
  .contributor-info a:hover,
  .contributor-info a:hover i {
    color: #666;
  }
</style>


<script>
$(function () {
  $('.tag-header [data-toggle="tooltip"]').tooltip();
});
</script>
